package cn.magicduck.demo.impl;

import cn.magicduck.demo.CacheService;
import cn.magicduck.demo.RedisUtils;

import java.util.concurrent.TimeUnit;

/**
 * @projectName: design-pattern-demo
 * @className: CacheServiceImpl
 * @description: 无须描述
 * @author: MagicDuck
 * @create: 2020-07-17 15:39
 **/
public class CacheServiceImpl implements CacheService {

    private RedisUtils redisUtils = new RedisUtils();

    public String get(String key) {
        return redisUtils.get(key);
    }

    public void set(String key, String value) {
        redisUtils.set(key, value);
    }

    public void set(String key, String value, long timeout, TimeUnit timeUnit) {
        redisUtils.set(key, value, timeout, timeUnit);
    }

    public void del(String key) {
        redisUtils.del(key);
    }
}
